1 using System;
2 using
System.Collections.Generic;
3 using
System.ComponentModel;
4 using
System.Drawing;
5 using
System.Linq;
6 using
System.Reflection;
7 using
System.Windows.Forms;
8
9 namespace
WarehouseManagementSystem
10 {
11     
partial class frmAbout : Form
12     {
13         
public frmAbout()
14         {
15             InitializeComponent();
16             
this.Text = String.Format("About {0}", AssemblyTitle);
17             
this.labelProductName.Text = AssemblyProduct;
18             
this.labelVersion.Text = String.Format("Version {0}", AssemblyVersion);
19             
this.labelCopyright.Text = AssemblyCopyright;
20             
this.labelCompanyName.Text = AssemblyCompany;
21             
this.textBoxDescription.Text = AssemblyDescription;
22         }
23
24         
#region Assembly Attribute Accessors
25
26         
public string AssemblyTitle
27         {
28             
get
29             {
30                 
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
31                 
if (attributes.Length > 0)
32                 {
33                     AssemblyTitleAttribute titleAttribute = (AssemblyTitleAttribute)attributes[
0];
34                     
if (titleAttribute.Title != "")
35                     {
36                         
return titleAttribute.Title;
37                     }
38                 }
39                 
return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().CodeBase);
40             }
41         }
42
43         
public string AssemblyVersion
44         {
45             
get
46             {
47                 
return Assembly.GetExecutingAssembly().GetName().Version.ToString();
48             }
49         }
50
51         
public string AssemblyDescription
52         {
53             
get
54             {
55                 
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
56                 
if (attributes.Length == 0)
57                 {
58                     
return "";
59                 }
60                 
return ((AssemblyDescriptionAttribute)attributes[0]).Description;
61             }
62         }
63
64         
public string AssemblyProduct
65         {
66             
get
67             {
68                 
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyProductAttribute), false);
69                 
if (attributes.Length == 0)
70                 {
71                     
return "";
72                 }
73                 
return ((AssemblyProductAttribute)attributes[0]).Product;
74             }
75         }
76
77         
public string AssemblyCopyright
78         {
79             
get
80             {
81                 
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
82                 
if (attributes.Length == 0)
83                 {
84                     
return "";
85                 }
86                 
return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
87             }
88         }
89
90         
public string AssemblyCompany
91         {
92             
get
93             {
94                 
object[] attributes = Assembly.GetExecutingAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
95                 
if (attributes.Length == 0)
96                 {
97                     
return "";
98                 }
99                 
return ((AssemblyCompanyAttribute)attributes[0]).Company;
100             }
101         }
102         
#endregion
103
104         
private void frmAbout_Load(object sender, EventArgs e)
105         {
106
107         }
108
109         
private void okButton_Click(object sender, EventArgs e)
110         {
111             Close();
112         }
113     }
114 }


Gõ tìm kiếm nhanh...